﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;

namespace System.Data.DataSetGenerator
{
    [XmlType("DataAdapter")]
    [Serializable]
    public class DataAdapterDescriptor : 
        IDataAdapterDescriptor
    {
        public DataAdapterDescriptor()
        {
            Util.InitializeObject(this);
        }

        [DefaultValue(ConflictOption.CompareRowVersion)]
        [XmlAttribute]
        public ConflictOption ConflictOption {get;set;}

        /// <summary>
        /// The output file of generated code unit.
        /// </summary>
        [DefaultValue("")]
        [XmlAttribute]
        public string DataAdaptersFileName {get;set;}

        /// <summary>
        /// The namespace for generated class files. The default namespace is the global namespace.
        /// </summary>
        [DefaultValue("")]
        [XmlAttribute]
        public string DataAdaptersNamespace {get;set;}


        /// <summary>
        /// If true, does not includes computed column names in the insert and update statement. Default is true.
        /// </summary>
        [DefaultValue(true)]
        [XmlAttribute]
        public bool IgnoreComputedColumnsForInsertAndUpdate {get;set;}

        [DefaultValue(UpdateRowSource.FirstReturnedRecord)]
        [XmlAttribute]
        public UpdateRowSource UpdatedRowSource {get;set;}

        [DefaultValue("")]
        [XmlAttribute]
        [Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public String TableName { get; set; }

        [DefaultValue("")]
        [XmlAttribute]
        public String BaseClass { get; set; }
    }
}
